import { createRouter, createWebHistory } from 'vue-router'
const routes = [
  {
    path: '/',
    redirect: '/home' // 当访问根路径时，重定向到 '/task'
  },
  {
    name: 'element',
    path: '/element',
    component: () => import('@/views/element/element.vue'),
    children: [
      {
        path: 'scrollbar',
        component: () => import('@/views/element/scrollbar.vue')
      },
      {
        path: 'base',
        component: () => import('@/views/element/base.vue')
      }
    ]
  },
  {
    name: 'test',
    path: '/test',
    component: () => import('@/views/test.vue')
  }
]
const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
